function [sigmodel,sigdata,corr]=s_overview(dat,nmodel)

% -----------------------------------------------------------
% -- Statistics
% -----------------------------------------------------------
% G. Charria (10/2008)

% Reshape model and data as a vector
if isfield(dat,'timedata') && (length(dat.timedata) ~= length(nmodel.time))
    [c,ia,ib]=intersect(dat.timedata,nmodel.time);    
    m=reshape(nmodel.data(:,:,ib),[numel(nmodel.data(:,:,ib)) 1]);
    d=reshape(dat.data(:,:,ia),[numel(dat.data(:,:,ia)) 1]);
    disp('coucou')
else
    m=reshape(nmodel.data,[numel(nmodel.data) 1]);
    d=reshape(dat.data,[numel(dat.data) 1]);
end
% Compute statistics
sigmodel=nanstd(m(find(~isnan(m) & ~isnan(d))));
sigdata=nanstd(d(find(~isnan(m) & ~isnan(d))));
c=corrcoef(m(find(~isnan(m) & ~isnan(d))),d(find(~isnan(m) & ~isnan(d))));
corr=c(1,2);

